public class Sentence
{
   private String text;

   /**
      Constructs a sentence.
      @param words the words in the sentence
   */
   public Sentence(String words) 
   { 
      // your work here
      text = words;
   }

   /**
      Count the number of spaces in the sentence.
      @return number of spaces
   */
   public int numSpaces() 
   {
      // your work here
      int count = 0;
      for(int i = 0; i < text.length(); i++)
      {
         if(text.charAt(i) == ' ')
         {
            count++;
         }
      }
      return count;
   }

   /**
      Count the number of vowels in the sentence.
      @return number of vowels
   */
   public int numVowels() 
   {
      // your work here
      int count = 0;
      for(int i = 0; i < text.length(); i++)
      {
         if(text.charAt(i) == 'A' || text.charAt(i) == 'E' || text.charAt(i) == 'I' || text.charAt(i) == 'O' || text.charAt(i) == 'U')
         {
            count++;
         }
         if(text.charAt(i) == 'a' || text.charAt(i) == 'e' || text.charAt(i) == 'i' || text.charAt(i) == 'o' || text.charAt(i) == 'u')
         {
            count++;
         }
      }
      return count;
   }

   /**
      Get the number of consonants in the sentence.
      @return the number of consonants
   */
   public int numCons() 
   {
      return text.length() - this.numSpaces() - this.numVowels();
   }

   /**
      Get the ratio of vowels to consonants for words in the sentence.
      @return the ratio of vowels to consonants
   */
   public double ratioVowelsToCons() 
   {
      // your work here
      return (double)this.numVowels() / this.numCons(); 
   }
   
 
   // This method is used for checking your work. Do not modify it

   public static String check(String aSent)
   {
      Sentence aSentence = new Sentence(aSent);
      return String.format("%4.2f",aSentence.ratioVowelsToCons());
   }

}